1. Field of the Invention
The present invention relates generally to key control in an electronic apparatus, a portable device, etc., which have a key matrix circuit, and, more particularly, to a key control circuit, an electronic apparatus, a portable device, and a key control method that suppress current consumption resulting from unintended key pressing.
2. Description of the Related Art
A portable terminal device is one form of an electronic apparatus having a plurality of keys and a built-in key matrix circuit that detects pressing of any one of the keys. Such a portable terminal device has now evolved into a third generation portable device, which comes to have enlarged functions and a smaller and thinner housing. The portable terminal device is put in a bag or a pocket of a garment to be carried around, and is likely to be under pressure load when carried around. Aside from natural load that arises when portable terminal device is carried, the portable terminal device may also be subjected to additional pressure load that is caused by a user's attaching a “peeking preventive sheet” or “key top face seal”. As the portable terminal device acquires improved fashionableness in addition to a call function and an information processing function, this tendency of additional pressure load is expected to become stronger and more extensive.
Japanese Patent Application Laid-Open Publication No. 2006-4052 discloses a key matrix circuit device related to a key matrix circuit used in an electronic apparatus such as a portable device. The key matrix circuit device includes a key matrix circuit unit having matrix wiring consisting of m×n (m, n≧3) lines with key switches each located at the intersection between lines, and scans the state of keys through a change in the state of an I/O port of a CPU to recognize simultaneous pressing of three or more keys resulting from any given one or two input events (see ABSTRACT, FIG. 1, etc.).
Japanese Patent Application Laid-Open Publication No. H09-64803 discloses a cellular phone related to the prevention of misoperation of keys on a keyboard, etc. The cellular phone has a key misoperation preventive function working in such a way that when a key on the keyboard is pressed, a key pressing detecting unit detects a press of the key, and, when a misoperation preventive key is on, a misoperation preventive detecting unit sends a misoperation preventive signal to a control unit to cause the control unit to disable the press of the key on the keyboard. When a key is pressed when the misoperation preventive key is active, therefore, the cellular phone turns on a light-emitting diode (see ABSTRACT, FIG. 1, etc.).
Japanese Patent Application Laid-Open Publication No. 2004-128814 discloses preventing contact between an operation unit and a display unit in a foldable portable device having the operation unit carrying keys. In the portable device, a recession deeper than the height of a projecting operation device of the operation unit is formed on a housing contact face of a housing at the display unit side to prevent the contact (see ABSTRACT, FIG. 1, etc.).
Some portable devices can be shifted in shape. Such portable devices include one that is changed from a closed state (folded state) to an opened state and vice versa, one that allows an operation unit to be slid out, and one that, when closed, allows part of a housing to be rotated and exposed. An openable/closable portable device poses a problem when its housing becomes thinner and a so-called clearanceless effort progresses to reduce a gap between a fixed side housing unit and a movable side housing unit. The problem is that foreign matter may come in between the fixed side housing and the movable side housing to cause an unintended key pressing. The occurrence of key pressing leads to key pressing detection, which consumes unnecessary currents. This current consumption accelerates the exhaustion of a battery.
FIG. 1 will be referred to in describing a conventional portable device having such a key matrix circuit. FIG. 1 depicts a conventional portable device having a key matrix circuit. This portable device 400 includes a key matrix circuit 402, a control unit 404, and an opening/closing detection circuit 406. For detecting key pressing, the key matrix circuit 402 has a hardware configuration, and input to a CPU included in the control unit 404 is concentrated in a single interruption line. The CPU searches for an interruption factor, i.e., a pressed key.
The key matrix circuit 402 has a plurality of key switches K11, K12 . . . K66 that are arranged in a matrix consisting of 6 rows and 6 columns. The portable device 400 equipped with this key matrix circuit 402 can be opened and closed, so that the keys not used when the portable device 400 is closed (closed state) serve as internal keys, and the keys used regardless of the state of housing units, such as side keys, serve as external keys. The external keys are, for example, the keys exposing out of the closed housing, and are expected to be used even when the portable device 400 is in the closed state. In this case, in the key matrix circuit 402, key switches K14a, K24a, K33a, K43a, K53a, and K64a selected from the key switches K11, K12 . . . K66 are determined to be the external keys, and the other key switches K11, K12 . . . K66 excluding the external keys are determined to be the internal keys. On the line of the key switches K33a, K43a, and K53a, key switches K13b, K23b, and K63b serving as internal keys are situated. On the line of the key switches K14a, K24a, and K64a, key switches K34b, K44b, and K54b serving as internal keys are situated. This means that when the portable device 400 is in the closed state to mask the internal keys, the key switches K13b, K23b, K34b, K44b, K54b, and K63b on the lines carrying the external keys cannot be masked because detection of a press of an external key have to be allowed.
The control unit 404 carries out key pressing on the key matrix circuit 402 and detection of a pressed key as well. The control unit 404 detects key pressing on the key matrix circuit 402 through a common matrix concentrative interruption line 408, and, to search for a place of key pressing that is an interruption factor, i.e., a pressed key, gives a key detection control signal to the column lines of the key matrix circuit 402 through key detection control lines 410, and then takes in a key detection signal indicating the pressed key from the row line side of the key matrix circuit 402 through key detection lines 412.
Since the portable device 400 can be opened and closed, the opening/closing detection circuit 406 detects opening and closing of the housing, and the control unit 404 receives an opening/closing detection signal from the opening/closing detection circuit 406 to carry out masking control on the key matrix circuit 402.
FIG. 2 will be referred to in describing the operation of the portable device 400 having such a key matrix circuit 402. FIG. 2 is a flowchart of a procedure of key control.
In this procedure, when the opening/closing detection circuit 406 detects the closed state, detection of a press (key interruption) of any one of the key switches K13b, K23b, K34b, K44b, K54b, and K63b serving as internal keys is carried out (step S1). If any one of the key switches K13b, K23b, K34b, K44b, K54b, and K63b is pressed (YES at step S1), the key interruption is ignored (step S2), and key releasing detection (polling) is carried out until the pressed key is released (step S3).
FIG. 3 will be referred to in describing control carried out by the control unit 404. FIG. 3 is a timing chart of key control.
In FIG. 3, A denotes detection output from the opening/closing detection circuit 406, representing the opened/closed state of the portable device 400 by expressing the opened state as “opened” and the closed state as “closed”. When any one of the key switches K13b, K23b, K34b, K44b, K54b, and K63b in a released state is pressed when the portable device 400 is in the closed state, as shown in B, key pressing interruption occurs in response to an event of the key pressing, which changes the operation status of the CPU (Central Processing Unit) of the control unit 404 from a standby status to an awake status, as shown in C. As a result, as shown in D, key detection changes from an interruption status in the closed state to a polling status, which is maintained until the pressed key is released. When the polling status is canceled, the CPU becomes the standby status, at which key detection becomes the interruption status.
Once an internal key is pressed, polling starts to detect the release of the pressed internal key, and continues till the release of the pressed key. Since the CPU remains awake to keep polling, current is consumed at the CPU side. If an external key is pressed in this situation, the on-going polling enables detection of the press of the external key. When the release of the internal key is detected through polling, key detection returns to interruption key detection as the CPU returns to the standby status.
In this case, a press of an external key must be detected even when the portable device 400 is closed, so that all key pressing events cannot be masked when internal keys and external keys are present together in the key matrix circuit 402.
Because of this, according to the portable device 400, when an internal key supposed to be unused in the closed state is pressed for any reason, detection of the press of the internal key is continued in a polling process to consume current. To suppress unnecessary current consumption at the CPU side in this case, for example, the internal keys and the external keys may be configured as separate key matrix circuits. This approach allows masking of only the internal keys, but complicates the circuit structure and doubles the burden of a key searching function. The approach, therefore, is not recommendable.
To effectively use keys on a single key matrix circuit without increasing its scale, therefore, it is essential to place together external keys allowing pressing detection even in the closed state and internal keys not requiring pressing detection in the closed state. In such a configuration, the internal keys allowing pressing detection are present in the same manner as the external keys allowing pressing detection when most of the entire internal keys are masked. When any one of the internal keys allowing pressing detection is pressed, therefore, the pressing detection as described above is carried out, which results in unnecessary power consumption.
About these problems, Japanese Patent Application Laid-Open Publication Nos. 2006-4052, H09-64803, and 2004-128814 do not disclose or suggest anything, and do not disclose any solution to the problems, either.